<template>
  <AuthPage v-if="!idLogin"/>
  <MainPage v-else/>
</template>

<script>
import MainPage from './components/MainPage.vue';
import AuthPage from './components/AuthPage.vue';

export default {
  name: 'App',
  components: {
    MainPage,
    AuthPage
  },
  data() {
    return {
      idLogin: false,
    }
  },
  created() {
    const loginUser = this.$cookies.get('loginUser');
    console.log('登录用户信息',loginUser)
    this.updateLoginStatus(!!loginUser);
  },
  methods: {
    updateLoginStatus(status) {
      this.idLogin = status;
    }
  }
}
</script>

<style>
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
